<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/share/_meta.jsp" %>
<%@ include file="/share/_footer.jsp" %>
<div class="page-container">
    <form class="form form-horizontal" id="myform">
        <input type="hidden" value="${ids }" name="ids" id="ids">    
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">手机号：</label>
            <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="layui-input input-text radius size-L" placeholder="用于短信提醒" value="" name="buyerPhone" id="buyerPhone">
            </div>
        </div>
         <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">购方税号：</label>
            <div class="formControls col-xs-8 col-sm-9">
             <input type="text" class="layui-input input-text radius size-L" placeholder="企业要填，个人可为空" value="" name="buyerTaxNum" id="buyerTaxNum">
            </div>
        </div>      
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                <button type="button" class="btn btn-secondary radius size-L" id="save">立即开票</button>
                <button type="button" class="btn btn-secondary radius size-L" onclick="layer_close();">取&nbsp;消</button>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
$('#save').click(function(){
	var ids=$("#ids").val();
	var arraysNew=[];
	arraysNew=ids.split(",");
	$("#myform").ajaxSubmit({
        url: "${pageContext.request.contextPath }/rest/nuonuoInvoice",
        data:{
            ids : arraysNew
        },
        beforeSubmit: function () {
            layer.load();
        },
        success: function(data){
            layer.closeAll('loading');
            if (data.success) {
                window.parent.location.reload();
            }else {
                layer.alert(data.message);
            }
        },
        error: function(XmlHttpRequest, textStatus, errorThrown){
            layer.closeAll('loading');
            layer.alert('error!',{icon:1,time:2000});
        }
    });
});
</script>